@extends('admin.layouts')
@section('css')
    <link href="{{asset('assets/css/bootstrap.min.css')}}" rel="stylesheet" />
    <link rel="stylesheet" href="{{asset('assets/css/font-awesome.min.css')}}" />
    <link rel="stylesheet" href="http://fonts.googleapis.com/css?family=Open+Sans:400,300" />

    <link rel="stylesheet" href="{{asset('assets/css/ace.min.css')}}" />
    <link rel="stylesheet" href="{{asset('assets/css/ace-rtl.min.css')}}" />
    <link rel="stylesheet" href="{{asset('assets/css/ace-skins.min.css')}}" />
    <script src="{{asset('assets/js/ace-extra.min.js')}}"></script>
    <link rel="stylesheet" type="text/css" href="{{asset('assets/uploadifive/uploadifive.css')}}">
    <style>
        .uploadifive-button{border:none; border-radius:1px; height: 28px;background:#3bb4f2;color:#fff;}
        #uploadifive-file_upload{margin:auto}
        .uploadifive{display:inline-block;}
        /*.uploadifive-button{border:none; border-radius:1px; height: 28px;}*/
    </style>
@endsection
@section('content')


    <div class="main-content">
        <div class="breadcrumbs" id="breadcrumbs">
            <script type="text/javascript">
                try{ace.settings.check('breadcrumbs' , 'fixed')}catch(e){}
            </script>

            <ul class="breadcrumb">
                <li>
                    <i class="icon-home home-icon"></i>
                    <a href="#">首页</a>
                </li>
                <li class="active">管理员详情</li>
            </ul><!-- .breadcrumb -->

            <div class="nav-search" id="nav-search">
                <form class="form-search">
								<span class="input-icon">
									<input type="text" placeholder="Search ..." class="nav-search-input" id="nav-search-input" autocomplete="off" />
									<i class="icon-search nav-search-icon"></i>
								</span>
                </form>
            </div><!-- #nav-search -->
        </div>

        <div class="page-content">
            <div class="page-header">
                <h1>
                    管理员详情
                </h1>
            </div><!-- /.page-header -->

            <div class="row">
                <div class="col-xs-12">
                    <!-- PAGE CONTENT BEGINS -->

                    <div>
                        <div id="user-profile-1" class="user-profile row">
                            <div class="col-xs-12 col-sm-3 center">
                                <div>
                                    {{--<input type="hidden" class="col-xs-4" id="adminAvatar" readonly value="" name="avatar">--}}


                                    <span class="profile-picture">
                                        <img id="shoAvatar" class="editable img-responsive" style="width: 180px;height: 200px" alt="Alex's Avatar"
                                             @if(!empty(Session::get('admin')['avatar']))
                                                src="{{Session::get('admin')['avatar']}}"
                                             @else
                                                src="{{asset('assets/avatars/profile-pic.jpg')}}"
                                            @endif
                                        />
                                    </span>
                                    <input id="file_upload" type="file" name="avatar" />
                                    <div id="tip-queue" class="col-xs-4" style="display: none"></div>

                                    <div class="space-4"></div>

                                    <div class="width-80 label label-info label-xlg arrowed-in arrowed-in-right">
                                        <div class="inline position-relative">
                                            <a href="#" class="user-title-label dropdown-toggle" data-toggle="dropdown">
                                                <i class="icon-circle light-green middle"></i>
                                                &nbsp;
                                                <span class="white">{{Session::get('admin')['username']}}</span>
                                            </a>
                                        </div>
                                    </div>
                                </div>

                                <div class="space-6"></div>

                            </div>

                            <div class="col-xs-12 col-sm-9">
                                <div class="center">
												<span class="btn btn-app btn-sm btn-light no-hover">
													<span class="line-height-1 bigger-170 blue"> {{$num['user']}} </span>

													<br />
													<span class="line-height-1 smaller-90"> 用户 </span>
												</span>

												<span class="btn btn-app btn-sm btn-yellow no-hover">
													<span class="line-height-1 bigger-170"> {{$num['author']}} </span>

													<br />
													<span class="line-height-1 smaller-90"> 作者 </span>
												</span>

												<span class="btn btn-app btn-sm btn-pink no-hover">
													<span class="line-height-1 bigger-170"> {{$num['article']}} </span>

													<br />
													<span class="line-height-1 smaller-90"> 文章 </span>
												</span>

												<span class="btn btn-app btn-sm btn-grey no-hover">
													<span class="line-height-1 bigger-170"> {{$num['images']}} </span>

													<br />
													<span class="line-height-1 smaller-90"> 图册 </span>
												</span>

											{{--	<span class="btn btn-app btn-sm btn-success no-hover">
													<span class="line-height-1 bigger-170"> 7 </span>

													<br />
													<span class="line-height-1 smaller-90"> Albums </span>
												</span>

												<span class="btn btn-app btn-sm btn-primary no-hover">
													<span class="line-height-1 bigger-170"> 55 </span>

													<br />
													<span class="line-height-1 smaller-90"> Contacts </span>
												</span>--}}
                                </div>

                                <div class="space-12"></div>

                                <div class="space-20"></div>

                                <div class="widget-box transparent">
                                    <div class="widget-header widget-header-small">
                                        <h4 class="blue smaller">
                                            <i class="icon-rss orange"></i>
                                            最近状态
                                        </h4>
                                    </div>

                                    <div class="widget-body">
                                        <div class="widget-main padding-8">
                                            <div id="profile-feed-1" class="profile-feed">
                                                @foreach($logs as $log)
                                                <div class="profile-activity clearfix">
                                                    <div>
                                                        <img class="pull-left" alt="Susan Smith's avatar" src="{{asset('assets/avatars/avatar2.png')}}" />
                                                        <a class="user" href="#"> {{$log['username']}} </a>
                                                        {{$log['event']}}
                                                        <div class="time">
                                                            <i class="icon-time bigger-110"></i>
                                                            {{date('Y-m-d H:i:s',$log['created_at'])}}
                                                        </div>
                                                    </div>
                                                </div>
                                            @endforeach
                                            </div>
                                        </div>
                                    </div>
                                </div>

                                <div class="hr hr2 hr-double"></div>

                            </div>
                        </div>
                    </div>

                    <!-- PAGE CONTENT ENDS -->
                </div><!-- /.col -->
            </div><!-- /.row -->
        </div><!-- /.page-content -->
    </div><!-- /.main-content -->


    @endsection

@section('javascript')
    <script src='{{asset('assets/js/jquery-2.0.3.min.js')}}'></script>
    <script src="{{asset('assets/js/bootstrap.min.js')}}"></script>
    <script src="{{asset('assets/js/typeahead-bs2.min.js')}}"></script>

    <!-- ace scripts -->
    <script type="text/javascript" src="{{asset('assets/layer/layer.js')}}"></script>
    <script src="{{asset('assets/js/ace-elements.min.js')}}"></script>
    <script src="{{asset('assets/js/ace.min.js')}}"></script>

    <script type="text/javascript" src="{{asset('assets/uploadifive/jquery.uploadifive.js')}}"></script>
    <script src="{{asset('assets/js/jquery.slimscroll.min.js')}}"></script>

    <script type="text/javascript">


        $('#file_upload').uploadifive({
            'formData'     : {
                '_token'     : "{{csrf_token()}}"
            },
            'uploadScript' : "{{asset('admin/uploadimg')}}",
            'multi':false,
            'buttonText'   : '选择图片',   //按钮显示文字
            'queueID'      : 'tip-queue', //提示信息放置目标
            'fileType'     : 'image/*',   //允许上传文件类型
            'onSelect': function (file) {
                layer.load(1);
            },
            'onUploadComplete': function(file,data,response){
                layer.closeAll('loading');
                data= $.parseJSON(data);
                if(!data.status){
                    alert(data.msg);
                }else{
                    layer.msg('图片上传完毕');
                    $("#shoAvatar").attr('src',data.msg+'-185X141');
                    $.post('{{url('admin/admininfo')}}',{"_token":'{{csrf_token()}}','avatar':data.msg}, function (res) {
                        layer.msg(res.msg);
                    });
                }

            }
        });
        jQuery(function($) {
            //////////////////////////////
            $('#profile-feed-1').slimScroll({
                height: '300px',
                alwaysVisible : false
            });

        });
    </script>
    @endsection